{extend name="base" /}
{block name="content"}
<style type="text/css">
    .form-group img{
        border:1px dashed #ccc;
        padding: 3px;
    }
</style>
<div class="content">
    <div class="container-fluid">
        <!-- Page-Title -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box">
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="{:url('index/index')}"><i class="fe-home"></i> 控制台</a></li>
                            <li class="breadcrumb-item"><a href="javascript: void(0);">系统设置</a></li>
                            <li class="breadcrumb-item active">全局配置</li>
                        </ol>
                    </div>
                <h4 class="page-title"> 
                    <i class="fe-airplay"></i> 全局配置 </h4>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 col-md-6">
                <div class="alert alert-warning alert-dismissable">
                    <i class="mdi mdi-alert-outline mr-2"></i>
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                       保存成功将在 index 模块下生成一个config.php 配置文件
                </div>  
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="card-box">
                    <h4 class="header-title mb-4"> &nbsp;&nbsp;<a class="btn btn-danger btn-xs waves-effect waves-light" style="color: #fff" onclick="postBtn()" >保存配置</a></h4>
                    <ul class="nav nav-tabs nav-bordered">
                        <li class="nav-item">
                            <a href="#home" data-toggle="tab" aria-expanded="false" class="nav-link active">
                               Banner 设置
                            </a>
                        </li>
                        <li class="nav-item">
                            <a href="#aboutus" data-toggle="tab" aria-expanded="true" class="nav-link">
                                基本设置
                            </a>
                        </li>
                    </ul>
                        <form id="form1">

                    <div class="tab-content">
                        <div class="tab-pane show active" id="home">
                            <div class="col-lg-8 col-md-8">
                                <div class="card-box">
                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">Home banner url</label>
                                        <div class="col-9">
                                            <input type="text" class="form-control" value="{$system['HOME_BANNER_URL']}" name="HOME_BANNER_URL" placeholder="首页banner跳转链接">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">Home banner</label>
                                        <div class="col-9">
                                            <img class="vatar-xl" src="/uploads/{$system['HOME_BANNER']}" id="btn1_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="HOME_BANNER" name="HOME_BANNER"  value="{$system['HOME_BANNER']}" readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn1" > 
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">Campaign banner</label>
                                        <div class="col-9">
                                            <img class=" vatar-xl" src="/uploads/{$system['CAMPAIGN_BANNER']}" id="btn2_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="CAMPAIGN_BANNER" value="{$system['CAMPAIGN_BANNER']}" name="CAMPAIGN_BANNER"  readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn2">
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>
                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">New Collection banner</label>
                                        <div class="col-9">
                                            <img class=" vatar-xl" src="/uploads/{$system['COLLE_BANNER']}" id="btn6_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="COLLE_BANNER" value="{$system['COLLE_BANNER']}" name="COLLE_BANNER"  readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn6">
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>
                                            <br/>
                                            <br/>
                                            <img class=" vatar-xl" src="/uploads/{$system['NEW_BANNER']}" id="btn3_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="NEW_BANNER" value="{$system['NEW_BANNER']}" name="NEW_BANNER"  readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn3">
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>

                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">Store Image</label>
                                        <div class="col-9">
                                            <img class=" vatar-xl" src="/uploads/{$system['STORE_BANNER']}" id="btn4_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="STORE_BANNER" value="{$system['STORE_BANNER']}" name="STORE_BANNER"  readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn4">
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>
                                        </div>
                                    </div>

                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">About  banner</label>
                                        <div class="col-9">
                                            <img class=" vatar-xl" src="/uploads/{$system['ABOUT_BANNER']}" id="btn5_url" style="margin-bottom: 10px; width: 50%"><br/>
                                            <input type="hidden" class="form-control" id="ABOUT_BANNER" value="{$system['ABOUT_BANNER']}" name="ABOUT_BANNER"  readonly>
                                            <button type="button" class="layui-btn layui-btn-xs" id="btn5">
                                                <i class="layui-icon">&#xe67c;</i>上传&nbsp;
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="aboutus">
                            <div class="col-lg-8 col-md-8">
                                <div class="card-box">
                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">COPY_NAME</label>
                                        <div class="col-9">
                                            <input type="text" class="form-control" id="COPY_NAME" value="{$system['COPY_NAME']}" name="COPY_NAME" placeholder="COPY_NAME">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="user" class="col-3 col-form-label">WEB_NAME</label>
                                        <div class="col-9">
                                            <input type="text" class="form-control" value="{$system['WEB_NAME']}" id="WEB_NAME" name="WEB_NAME" placeholder="WEB_NAME">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                       

                       
                    </div>
                        </form>

                </div> <!-- end card-box-->
            </div> <!-- end col -->
       
    </div> <!-- container -->
</div> <!-- content -->
<script src="/static/layui/layui.js"></script>
<script src="/static/index/assets/js/uploads.js"></script>
<script type="text/javascript">
    layui.use(['element', 'form', 'layedit','upload'], function () {
        var form = layui.form;
        var $ = layui.jquery,upload = layui.upload;
    })
    function postBtn(e){
        layer.msg('正在生成配置文件 · · · ',{icon:7, time:2000, shade: [0.2, '#000']});
        // layer.load(2, {time: 2000});
        var data = $('#form1').serialize();
        $.post('/admin/system/pc', data, function(res){
            if(res.code == 0){
                setTimeout(function(){
                    layer.msg(res.message,{icon:1, time: 1000, shade: [0.2, '#000'], time:800});
                },1000);
            }else{
                layer.msg(res.message,{icon:5, anim: 6});
            }
        },'json');
    }
</script>
{/block}